package com.tony.jpatest.configurations;

import org.springframework.context.annotation.Configuration;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer;

@Configuration
public class MyRestConfig implements RepositoryRestConfigurer {
    @Override
    public void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
        config.setPageParamName("page")
                .setLimitParamName("size")
                .setSortParamName("sort")
                .setDefaultPageSize(2)
                .setBasePath("/v1/api")
                .setReturnBodyOnCreate(true);
    }
}
